package com.jz.community.basecomm.utils;

import android.content.Context;

import com.jz.community.basecomm.constant.AppConstants;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;

/**
 * Created by Tony.Fan on 2018/3/23 14:31
 */
public class WXUtils {

    private static WXUtils wxPayUtil = new WXUtils();

    public static WXUtils getInstance() {
        return wxPayUtil;
    }

    //检测是否安装微信
    public boolean isWxInstalledAndSurported(Context context) {
        IWXAPI wxAPI = WXAPIFactory.createWXAPI(context, AppConstants.WX_APP_ID);
        wxAPI.registerApp(AppConstants.WX_APP_ID);
        return wxAPI.isWXAppInstalled() && wxAPI.isWXAppSupportAPI();
    }

}
